<%@ page contentType="text/html; charset=utf-8" import="java.util.*" pageEncoding="utf-8"%>

<script>
function searchTo(){
	var qword=$('#qword').val();
	if($.trim(qword)==""){
		return false;
	}
	var url=$(":radio[name='stype']:checked").val();
	var searchUri=url+$.trim(qword);
	window.open(encodeURI(searchUri));
}
$(function(){$("#infoshow").hide();});
function validateForm(){
	var msg="";
	var $login_form=$("#login_form");
	var usercode=$("#usercode",$login_form).val();
	var pwd=$("#pwd",$login_form).val();
	var checkcode=$("#checkcode",$login_form).val();
	if($.trim(usercode)==""){
		msg=("登录账号不能为空");
	}else if($.trim(pwd)==""){
		msg=("密码不能为空");
	}else if($.trim(checkcode)==""){
		msg="验证码不能为空";
	}
	if(msg!=""){
		$("#infoshow").addClass("fieldmsg-error").show().html(msg);
	}
	return msg=="";
}
</script>
<c:if test="${tt==null}">
<div id="balloon1" class="balloonstyle">
<img style="margin-right:20px;margin-top:10px;float:right;cursor:pointer;" title="关闭登录窗口" onclick="javascript:$('#balloon1').hide();" src="${path }/themes/images/cancel.png" border="0"/>
<div id="login_form">
	<form action="${path }/userinfo/login" onsubmit="if(validateForm()==true)ajaxSubmit(this,loginSubmit);return false;">
	<table>
		<tr>
			<td align="right" width="160">会员名/邮箱/手机号码:</td>
			<td align="left"><input type="text" id="usercode" name="usercode" style="width:180px;"></td>
		</tr>
		<tr>
			<td align="right">密码:</td>
			<td align="left"><input type="password" id="pwd" name="pwd" style="width:180px;"></td>
		</tr>
		<tr>
			<td align="right">验证码:</td>
			<td align="left"><input type="text" id="checkcode" name="checkcode" style="width:95px;float:left;"><span style="margin-left:5px;float:right;"><img id="codeImg" src="${path }/VC.jpg?<%=(new Date()).getTime()  %>" onclick="this.src='${path }/VC.jpg?id='+Math.random()*10"title="点击更新验证码" width="75" height="24" /></span></td>
		</tr>
		<tr>
			<td align="right">&nbsp;</td>
			<td align="left"><button class="btn_login" type="submit">登&nbsp;&nbsp;&nbsp;录</button><a style="margin-left:30px;" href="${path }/userinfo/reg">注册会员</a></td>
		</tr>
		<tr>
			<td colspan="2">
			<div id="infoshow" style="height:30px;width:250px" class="fieldmsg">
			
			</div>
			</td>
		</tr>
	</table>
	</form>
</div>
</div>
</c:if>
<div class="top">
	<table width="900px" height="51px" cellpadding="0" cellspacing="0" border="0">
		<tr>
			<td rowspan="2" width="660px">
	<div style="float:left;heigth:100%">
	<img style="margin-top:5px;" height="77px" border="0" alt="" src="${path }/themes/images/logo.png">
	</div>
			</td>
			<td width="240px">
	<div class="mini_nav_fl">
			<ul style="float:right;margin-right:0px;">
				<li >
				<c:if test="${tt==null&&user_session==null }">
				<a href="javascript:void(0)" class="logintn" onClick="login(this);" class="loginbtn">登录</a>
				</c:if>
				<c:if test="${user_session!=null &&user_session.id!=0}">
				欢迎你, <a href="${path }/userinfo/home" title="点击进入会员管理">${user_session.fullname }</a>&nbsp;&nbsp;<a href="javascript:logout();" title="点击退出">退出？</a>
				</c:if>
				</li>
				<li style=""><a href="javascript:void(0)" class="first" onClick="SetHome(this,window.location);">设为首页</a></li>
			</ul>
	</div>
			</td>
		</tr>
		<tr>
			<td align="right"  class="navigation">
		<ul>
			<li class="home"><a href="${path }">首 页</a></li>
			<li><a href="${path }/userinfo/home">资讯</a></li>
			<li class="Download"><a href="${path }/contact.jsp">联系我们</a></li>  
      </ul>
			</td>
		</tr>
	</table>
</div>


<div class="topsearchbar">
百度<input type="radio" value="http://www.baidu.com/s?wd=" checked="checked" name="stype">
谷歌<input type="radio" value="http://www.google.com.hk/search?hl=zh-CN&source=hp&biw=&bih=&q=" name="stype">
有道<input type="radio" value="http://www.youdao.com/search?ue=utf8&keyfrom=web.index&q=" name="stype">
<input type="text" id="qword"><button onclick="searchTo();" style="height:27px;">搜索</button>
</div>
